<?php
/*
 * Template Name: Business
 *
 * This template creates a business style page optionally including a slider, features and testimonials 
*/

get_header();
global $woo_options;
?>
<?php
$settings = array(
                'business_display_slider' => 'true', 
                'business_display_features' => 'true', 
                'business_display_testimonials' => 'true', 
                'business_display_blog' => 'true'
                );
                
$settings = woo_get_dynamic_values( $settings );
?> 
    <!-- #content Starts -->
	<?php woo_content_before(); ?>
    <div id="content" class="col-full">

        <?php if ( $woo_options[ 'woo_breadcrumbs_show' ] == 'true' && ! is_front_page() ) { ?>
            <?php woo_breadcrumbs(); ?>  
        <?php } ?>  

        <div id="business-intro">
            <?php 
            // Display WooSlider if activated and specified in theme options
            if ( 'true' == $settings['business_display_slider'] ) { 
                do_action( 'wooslider' );
            }
            ?>
            <?php if (have_posts()) : $count = 0; ?>
            <?php while (have_posts()) : the_post(); $count++; ?>
                                                                        
                <div <?php post_class(); ?>>

                    <h1 class="title"><?php the_title(); ?></h1>

                    <div class="entry">
                        <?php the_content(); ?> 
                    </div><!-- /.entry -->
                        
                </div><!-- /.post -->
                
                                                    
            <?php endwhile; else: ?>
            <?php endif; ?> 
            <?php 
            // Display Features if activated and specified in theme options
            if ( 'true' == $settings['business_display_features'] ) {
                do_action( 'woothemes_features' ); 
            }
            // Display Features if activated and specified in theme options
            if ( 'true' == $settings['business_display_testimonials'] ) {
                do_action( 'woothemes_testimonials' ); 
            }
            ?>
        </div>

        <?php if ( 'true' == $settings['business_display_blog'] ) { ?>
    
        <!-- #main Starts -->
        <div id="main" class="col-left">      
                    
		 

        <?php
        	if ( get_query_var( 'paged') ) { $paged = get_query_var( 'paged' ); } elseif ( get_query_var( 'page') ) { $paged = get_query_var( 'page' ); } else { $paged = 1; }
        	
        	$query_args = array(
        						'post_type' => 'post', 
        						'paged' => $paged
        					);
        	
        	$query_args = apply_filters( 'woo_blog_template_query_args', $query_args ); // Do not remove. Used to exclude categories from displaying here.
        	
        	query_posts( $query_args );
        	
        	if ( have_posts() ) {
        		$count = 0;
        		while ( have_posts() ) { the_post(); $count++;
        ?>                                                            
            <!-- Post Starts -->
            <div <?php post_class(); ?>>

                <?php if ( $woo_options['woo_post_content'] != 'content' ) woo_image( 'width=' . $woo_options['woo_thumb_w'] . '&height='.$woo_options['woo_thumb_h'] . '&class=thumbnail ' . $woo_options['woo_thumb_align'] ); ?> 
                
                <h2 class="title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                
                <?php woo_post_meta(); ?>
                
                <div class="entry">
					<?php global $more; $more = 0; ?>	                                        
                    <?php if ( $woo_options['woo_post_content'] == 'content' ) { the_content(__( 'Read More...', 'woothemes' ) ); } else { the_excerpt(); } ?>
                </div>
    			<div class="fix"></div>
    			
                <div class="post-more">      
					<span class="comments"><?php comments_popup_link( __( 'Leave a comment', 'woothemes' ), __( '1 Comment', 'woothemes' ), __( '% Comments', 'woothemes' ) ); ?></span>
                	<?php if ( $woo_options[ 'woo_post_content' ] == "excerpt" ) { ?>
					<span class="post-more-sep">&bull;</span>
                    <span class="read-more"><a href="<?php the_permalink(); ?>" title="<?php esc_attr_e( 'Continue Reading &rarr;', 'woothemes' ); ?>"><?php _e( 'Continue Reading &rarr;', 'woothemes' ); ?></a></span>
                    <?php } ?>
                </div>   
    
            </div><!-- /.post -->
                                                
        <?php
        		} // End WHILE Loop
        	
        	} else {
        ?>
            <div <?php post_class(); ?>>
                <p><?php _e( 'Sorry, no posts matched your criteria.', 'woothemes' ); ?></p>
            </div><!-- /.post -->
        <?php } // End IF Statement ?>  
    
            <?php woo_pagenav(); ?>
			<?php wp_reset_query(); ?>                

        </div><!-- /#main -->
            
		<?php get_sidebar(); ?>

        <?php } ?>

    </div><!-- /#content -->    
		
<?php get_footer(); ?>